//app.js
App({
  post: function (url, data = {}) {
    var promise = new Promise((resolve, reject) => {

      wx.request({
        url: `https://salus.syzhijie.com/api/${url}`,
        data: data,
        method: 'POST',
        header: {
          'content-type': 'application/x-www-form-urlencoded'
        },
        success: res => {
          resolve(res)
        },
        fail: res => {
          reject(res)
          console.log(res)
        }
      })

    }).catch(err => {
      throw err
    })
    return promise
  },
  globalData: {
    
  }
})